<template>
<div class="bh-backtop" :style="positionStyle" @click='scrollTop'>
	<slot></slot>
</div>
</template>

<script>
export default {
	name: 'bh-backtop',
	props: {
		right: {
			type: Number,
			default: 40,
		},
		bottom: {
			type: Number,
			default: 100,
		},
	},
	data() {
		return {
			visible: true,
		}
	},
	methods: {
		scrollTop() {
			window.scrollTo(0, 0);
		},
	},
	computed: {
		positionStyle() {
			return {
				right: this.right + 'px',
				bottom: this.bottom + 'px',
			};
		},
	},
}
</script>
